import React, { Component } from 'react'
import PropTypes from 'prop-types'

export default class Test extends Component {
  render() {
    return (
      <div>
        {this.props.colors.map((item) => (
          <li key={item}>{item}</li>
        ))}
      </div>
    )
  }
}
Test.propTypes = {
  // 校验规则，规定 colors 必须是一个数组
  colors: PropTypes.array,
}
